package com.zhkj.txg.module.mine.ui

import android.content.Context
import android.content.Intent
import android.view.View
import com.zhkj.lib.base.BaseActivity
import com.zhkj.txg.R
import com.zhkj.txg.module.mine.entity.NotificationEntity
import kotlinx.android.synthetic.main.activity_notification_detail.*

class NotificationDetailActivity : BaseActivity() {

    companion object {
        private val DATA = "data"
        fun open(context: Context, data: NotificationEntity) {
            val intent = Intent(context, NotificationDetailActivity::class.java)
                .putExtra(DATA, data)
            context.startActivity(intent)
        }
    }

    override val layoutResId: Int = R.layout.activity_notification_detail
    override fun statusTitleBar(): View? = titleNotification
    override fun initData() {
        titleNotification.setTitleTextContent(getString(R.string.system_notification))
        val data = intent.getSerializableExtra(DATA) as NotificationEntity
        tvNotificationDetailTitle.text = data.title
        tvNotificationDetailDate.text = data.createText
        tvNotificationDetail.text = data.content
    }
}